import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import router from './routes'
import {createPinia} from "pinia"
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import "@/assets/iconfont/icon.css"
// import piniaPluginPersistedstate from "pinia-plugin-persistedstate"
import piniaPluginPersistedstate from "pinia-plugin-persistedstate"
// custom element css
// import "@/styles/element.scss";
import mitt from 'mitt'
let Mit = mitt()

let app = createApp(App)
app.config.globalProperties.$Bus = Mit
let pinia = createPinia()
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }
  
pinia.use(piniaPluginPersistedstate)
app.use(router)
app.use(pinia)
app.use(ElementPlus)
app.mount('#app')
